#ifndef __AUDIOOBJECTBASE_INCLUDED
#define __AUDIOOBJECTBASE_INCLUDED

namespace Audio
{
	class ErroableObject
	{
	public:
		ErroableObject()
			: errorCode(0)
		{

		}
		void SetLastError(int error) { 
			errorCode = error;
			if(IsBad())
			{
				OnError();
			}
		}
		int  GetLastError() const { return errorCode; }

		bool IsBad() const { return errorCode != 0; }

		virtual void OnError() { }
	protected: 
		int errorCode;
	};
}

#endif